package com.gxa.modules.app.hospitalization.rechargeAndExpenses.controller;

import com.gxa.common.utils.Result;
import com.gxa.modules.app.hospitalization.rechargeAndExpenses.service.InpatientDetailAppService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import springfox.documentation.annotations.ApiIgnore;

import java.util.Map;

@Api(tags = "住院充值(充值的界面)")
@RestController
@Slf4j
@RequestMapping("/hospitalization/pay")
public class PayContorller {
    @Autowired
    private InpatientDetailAppService inpatientDetailAppService;

    @ApiOperation("充值")
    @ApiImplicitParams({
            @ApiImplicitParam(paramType = "query",name = "money",value = "充值金额",dataType = "double"),
            @ApiImplicitParam(paramType = "query",name = "id",value = "患者的id",dataType = "int"),
            @ApiImplicitParam(paramType = "query",name = "userId",value = "登录用户的id",dataType = "int"),
            @ApiImplicitParam(paramType = "query",name = "pwd",value = "用户输入的支付密码",dataType = "String"),
    })
    @GetMapping
    public Result<String> onlinePay(Double money, Integer id, Integer userId, String pwd) {
        String s = inpatientDetailAppService.pay(money, id, userId, pwd);
        return new Result<String>().ok(s);
    }
}
